//
//  NSString+Category.h
//  
//
//  Created by lee on 2017/11/14.
//
//

#import <Foundation/Foundation.h>

#import <UIKit/UIKit.h>

@interface NSString (Category)

+ (NSString *)numberLongString:(unsigned int)number;

- (NSAttributedString *)emhtmlWithColor:(UIColor *)color;

+ (NSString*)deviceVersion;//设备的型号

+(NSString *)filterRichString:(NSString *)str;//过滤富文本的内容
+(BOOL)isNullOrWhiteSpace:(NSString*)string;
+(NSString*)filterAnySpecialCharactersInString:(NSString*)string;

+(NSString*)finallyDateString:(NSString*)dateString;

-(BOOL)isRichString;//判断是不是富文本

///////////////////////////////////
-(NSString *)md5;
-(NSString *) base64;
-(NSString *) sha1;
-(NSString *) sha224;
-(NSString *) sha256;
-(NSString *) sha384;
-(NSString *) sha512;

-(NSString *) decodeBase64;

/////////////////////////

/// 判断内容是否全部为空格  yes 全部为空格  no 不是
+ (BOOL) isEmpty:(NSString *) str;


+ (NSString *)uuid;

///过滤html标签
+ (NSString *)filterHTML:(NSString *)html;


/// 修正精度
+(NSString *)reviseString:(NSString *)str;
-(NSString *)reviseString;

//处理小数点问题
+ (NSString *)getRealPrice:(NSString *)price;
- (NSString *)getRealPrice;

/// 返回label高度
- (CGFloat)getLabelHeightWithWidth:(CGFloat)width Font:(UIFont *)font;

/// 返回label高度，最小高度为minLabelheight
- (CGFloat)getLabelHeightWithMinLabelHeight:(CGFloat)minLabelheight Width:(CGFloat)width Font:(UIFont *)font;

/// 返回label对比minLabelheight增加高度（大于0）
- (CGFloat)getGainedLabelHeightWithMinLabelHeight:(CGFloat)minLabelheight Width:(CGFloat)width Font:(UIFont *)font;

/// 返回cell的高度,minLabelheight为label的最小高度，minCellheight为cell的最小高度
- (CGFloat)getCellHeightWithMinCellHeight:(CGFloat)minCellheight MinLabelHeight:(CGFloat)minLabelheight  Width:(CGFloat)width Font:(UIFont *)font;

/// 获取字符串长
- (CGFloat)getStringWidthWithHeight:(CGFloat)height Font:(UIFont *)font;


/// 秒 ——》00:12
- (NSString *)audioPlayLength;


/// 格式化倒计时（23:00:00)
+ (NSString *)getCountdownStringWithTimeIntervalSinceNow:(NSTimeInterval)timeInterval;

/// 是否有链接
- (BOOL)textCheckingTypeLink;

/// 第一个链接
- (NSURL *)textMatchFirstLink;

/// 2行，第index个字符换行
- (NSString *)line2AtIndex:(unsigned int)index;
+ (NSString *)line2AtIndex:(unsigned int)index withString:(NSString *)string;

/// 传入宽度，得到近似宽度的空格字符
+ (NSString *)getSpaceStringWithSpaceWidth:(CGFloat)width height:(CGFloat)height font:(UIFont *)font;

+(NSString *)getAudioSaveFilePath;

@end
